package com.wzx.ptplatform.controller;

import com.wzx.ptplatform.domain.*;
import com.wzx.ptplatform.service.*;

import io.swagger.annotations.Api;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RestController;

import java.util.List;

/**
 * @author 紫煦桉
 * 通用控制器
 */
@Api(tags = "通用模块")
@RestController
public class GeneralController {

    final UniversityService universityService;
    final MajorService majorService;
    final CityService cityService;
    final ProvinceService provinceService;
    final PoliticsService politicsService;
    final CompanyService companyService;
    final IndustryService industryService;
    final JobService jobService;
    final StudentService studentService;
    final PartTimeMessageService partTimeMessageService;

    public GeneralController(UniversityService universityService, MajorService majorService, CityService cityService, ProvinceService provinceService, PoliticsService politicsService, CompanyService companyService, IndustryService industryService, JobService jobService, StudentService studentService, PartTimeMessageService partTimeMessageService) {
        this.universityService = universityService;
        this.majorService = majorService;
        this.cityService = cityService;
        this.provinceService = provinceService;
        this.politicsService = politicsService;
        this.companyService = companyService;
        this.industryService = industryService;
        this.jobService = jobService;
        this.studentService = studentService;
        this.partTimeMessageService = partTimeMessageService;
    }

    @GetMapping("politics_option_message")
    public List<Politics> politicsOptionMessage() {
        return politicsService.findAll();
    }

    @GetMapping("university_option_message")
    public List<University> universityOptionMessage() {
        return universityService.findAll();
    }

    @GetMapping("major_option_message")
    public List<Major> majorOptionMessage() {
        return majorService.findAll();
    }

    @GetMapping("city_option_message")
    public List<City> cityOptionMessage() {
        return cityService.findAll();
    }

    @GetMapping("province_option_message")
    public List<Province> provinceOptionMessage() {
        return provinceService.findAll();
    }

    @GetMapping("company_option_message")
    public List<Company> companyOptionMessage() {
        return companyService.findAll();
    }

    @GetMapping("industry_option_message")
    public List<Industry> industryOptionMessage() {
        return industryService.findAll();
    }

    @GetMapping("job_option_message")
    public List<Job> jobOptionMessage() {
        return jobService.findAll();
    }

    @GetMapping("student_option_message")
    public List<Student> studentOptionMessage() {
        return studentService.findAll();
    }

    @GetMapping("part_time_message_option_message")
    public List<PartTimeMessage> partTimeMessageOptionMessage() {
        return partTimeMessageService.findAll();
    }
}
